<!DOCTYPE html>
<html lang="{{.Locale}}">
  <head>
    <meta charset="utf-8">
    <title>{{.Title}}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{asset .Domain "/styles/stack.css" .ContextName}}">
    {{.CozyUI}}
    {{.ThemeCSS}}
    {{.Favicon}}
  </head>
  <body>
    <main role="application">
      <section class="popup">
        <header class="u-ta-center">
          <span class="shield">
            <span class="c-avatar c-avatar--large">
              <img class="c-avatar-image" src="/public/avatar" alt="" />
            </span>
          </span>
        </header>
        <div class="container">
          <form method="POST" action="/auth/authorize/sharing" class="login auth">
            <input type="hidden" name="csrf_token" value="{{.CSRF}}" />
            <input type="hidden" name="sharing_id" value="{{.Sharing.SID}}" />
            <input type="hidden" name="state" value="{{.State}}" />
            <div role="region">
              <h1>{{t "Authorize Sharing Title" .SharerName}}</h1>
              <p class="help">
                {{- t "Authorize Sharing Request" .SharerName -}}
              </p>
              <ul class="perm-list">
                {{range $index, $rule := .Sharing.Rules}}
                <li class="{{ $rule.DocType }}">
                  {{- $rule.Title -}}
                </li>
                {{end}}
              </ul>
              <p>
                {{t "Authorize Sharing Permission start"}}
                <strong>
                  {{- if .Sharing.ReadOnly}}
                    {{t "Authorize Sharing Permission readonly"}}
                  {{else}}
                    {{t "Authorize Sharing Permission readwrite"}}
                  {{end -}}
                </strong>
                {{t "Authorize Sharing Permission end"}}
              </p>
              <p>{{t "Authorize Sharing Sync"}}</p>
              <ul>
                <li>{{t "Authorize Sharing Self" .Domain}}</li>
                <li>{{t "Authorize Sharing Client" .SharerDomain}}</li>
              </ul>
            </div>
            <footer>
              <div class="controls">
                <button type="submit" class="c-btn c-btn--full wizard-button"><span><span>{{- t "Authorize Submit Sharing" -}}</span></span></button>
              </div>
            </footer>
          </form>
        </div>
      </section>
    </main>
  </body>
</html>
